function [R,C,sens]=celdas_skgmay1(wp,qp,g,wz,seteados)
   %RECIBE:
   %wp,qp,g,wz: valores de la funcion
   %setados: R1 y R3
    R=ones(4,1);
    C=ones(2,1);
    
    R(1)=seteados(1);
    R(3)=seteados(2);
    R(2)=R(1);
    R(4)=R(3)/(g-1);
    C(2)=(1/(qp*2*wp*R(1))+sqrt((1/(qp*2*wp*R(1)))^2+4*R(3)/(2*R(4)*wp^2*R(1)^2)))/2;
    C(1)=1/(wp^2*R(1)^2*C(2));
    
    sens=ones(6,4);
    sens(:,1)=SenSallenLPGmay1W0(R(1),R(2),R(3),R(4),C(1),C(2));
    sens(:,2)=SenSallenLPGmay1Q(R(1),R(2),R(3),R(4),C(1),C(2));
    sens(:,3)=SenSallenLPGmay1G(R(1),R(2),R(3),R(4),C(1),C(2));
    sens(:,4)=[0,0,0,0,0,0];

end

function [senG]=SenSallenLPGmay1G(r1,r2,r3,r4,c1,c2)
  senG(1)=0;                                            %r1
  senG(2)=0;                                            %r2
  senG(3)=r3/(r4 + r3);                                 %r3
  senG(4)=-(r4^2*((r4 + r3)/r4^2 - 1/r4))/(r4 + r3);    %r4
  senG(5)=0;                                            %c1
  senG(6)=0;                                            %c2
end

function [senQ]=SenSallenLPGmay1Q(r1,r2,r3,r4,c1,c2)

senQ(1) = (r1*((r4*(c1*r3 - c2*r4))/((c2*r1*r4 - c1*r1*r3 + c2*r2*r4)^2*(1/(c1*c2*r1*r2))^(1/2)) + r4/(2*c1*c2*r1^2*r2*(c2*r1*r4 - c1*r1*r3 + c2*r2*r4)*(1/(c1*c2*r1*r2))^(3/2)))*(c2*r1*r4 - c1*r1*r3 + c2*r2*r4)*(1/(c1*c2*r1*r2))^(1/2))/r4;
senQ(2) =-(r2*((c2*r4^2)/((c2*r1*r4 - c1*r1*r3 + c2*r2*r4)^2*(1/(c1*c2*r1*r2))^(1/2)) - r4/(2*c1*c2*r1*r2^2*(c2*r1*r4 - c1*r1*r3 + c2*r2*r4)*(1/(c1*c2*r1*r2))^(3/2)))*(c2*r1*r4 - c1*r1*r3 + c2*r2*r4)*(1/(c1*c2*r1*r2))^(1/2))/r4;
senQ(3) =(c1*r1*r3)/(c2*r1*r4 - c1*r1*r3 + c2*r2*r4);
senQ(4) =(1/((c2*r1*r4 - c1*r1*r3 + c2*r2*r4)*(1/(c1*c2*r1*r2))^(1/2)) - (r4*(c2*r1 + c2*r2))/((c2*r1*r4 - c1*r1*r3 + c2*r2*r4)^2*(1/(c1*c2*r1*r2))^(1/2)))*(c2*r1*r4 - c1*r1*r3 + c2*r2*r4)*(1/(c1*c2*r1*r2))^(1/2);
senQ(5) =(c1*((r1*r4*r3)/((c2*r1*r4 - c1*r1*r3 + c2*r2*r4)^2*(1/(c1*c2*r1*r2))^(1/2)) + r4/(2*c1^2*c2*r1*r2*(c2*r1*r4 - c1*r1*r3 + c2*r2*r4)*(1/(c1*c2*r1*r2))^(3/2)))*(c2*r1*r4 - c1*r1*r3 + c2*r2*r4)*(1/(c1*c2*r1*r2))^(1/2))/r4;
senQ(6) =-(c2*((r4*(r1*r4 + r2*r4))/((c2*r1*r4 - c1*r1*r3 + c2*r2*r4)^2*(1/(c1*c2*r1*r2))^(1/2)) - r4/(2*c1*c2^2*r1*r2*(c2*r1*r4 - c1*r1*r3 + c2*r2*r4)*(1/(c1*c2*r1*r2))^(3/2)))*(c2*r1*r4 - c1*r1*r3 + c2*r2*r4)*(1/(c1*c2*r1*r2))^(1/2))/r4;

end

function [senw0]=SenSallenLPGmay1W0(r1,r2,r3,r4,c1,c2)

senw0(1) = -1/(2*c1*c2*r1*r2*(1/(c1*c2*r1*r2)));
senw0(2) = -1/(2*c1*c2*r1*r2*(1/(c1*c2*r1*r2)));
senw0(3) = 0;
senw0(4) = 0;
senw0(5) = -1/(2*c1*c2*r1*r2*(1/(c1*c2*r1*r2)));
senw0(6) = -1/(2*c1*c2*r1*r2*(1/(c1*c2*r1*r2)));

end